Rename Display Pyramid to Pyramidal Downsampling and align pyramid outputs#13
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Clearex’s analysis pipeline and UI to rename/relayout the “Display Pyramid” operation (now “Pyramidal Downsampling”), integrates a new canonical 6D registration workflow, and migrates display-pyramid outputs to source-adjacent component layouts while applying repo-wide Black formatting.
Changes:
- Renames “Display Pyramid” to “Pyramidal Downsampling”, moves it earlier in preprocessing, and migrates pyramid outputs to
<source>_pyramid/level_n(with legacy rebuild behavior). - Adds a new
clearex.registration.pipelineimplementation and wires registration execution intomain.py, workflow defaults/normalization, and GUI controls. - Updates GUI to present source-aware registration channel/resolution options and hides manual-anchor controls unless needed; refreshes/extends test coverage accordingly.
Reviewed changes
Copilot reviewed 43 out of 44 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/visualization/test_pipeline.py | Updates display-pyramid assertions and adds legacy-layout rebuild test. |
| tests/usegment3d/test_pipeline.py | Black formatting adjustment. |
| tests/test_workflow.py | Updates default orders, adds registration parameter normalization/validation tests, adds registration alias test. |
| tests/test_main.py | Updates workflow execution tests for registration Dask workload and chaining registration → visualization. |
| tests/shear/test_pipeline.py | Black formatting adjustments. |
| tests/segmentation/test_pointsource.py | Formats particle import list. |
| tests/segmentation/init.py | Removes trailing whitespace line. |
| tests/registration/test_pipeline.py | Adds new registration pipeline unit/integration tests. |
| tests/registration/test_image_registration.py | Black formatting adjustments. |
| tests/mip_export/test_pipeline.py | Black formatting adjustments. |
| tests/io/test_read.py | Removes blank line. |
| tests/io/test_provenance.py | Black formatting adjustments. |
| tests/io/test_experiment.py | Black formatting adjustments. |
| tests/gui/test_gui_execution.py | Adds GUI tests for registration tab placement, persistence, source-aware options, and anchor visibility; updates label text. |
| tests/flatfield/test_pipeline.py | Black formatting adjustments. |
| tests/conftest.py | Removes blank line. |
| tests/init.py | Black formatting adjustments. |
| src/clearex/workflow.py | Reorders operations, adds registration alias/output mapping, adds registration parameter normalization. |
| src/clearex/visualization/pipeline.py | Moves display pyramid storage to source-adjacent layout and adds legacy-layout detection/rebuild. |
| src/clearex/usegment3d/pipeline.py | Minor string formatting change. |
| src/clearex/stats/init.py | Trailing whitespace/format cleanup. |
| src/clearex/shear/pipeline.py | Typing import formatting + minor string formatting change. |
| src/clearex/shear/init.py | Removes trailing whitespace line. |
| src/clearex/segmentation/pointsource.py | Formats particle import list. |
| src/clearex/registration/tre.py | Removes blank line. |
| src/clearex/registration/pipeline.py | Adds new canonical 6D registration analysis pipeline implementation. |
| src/clearex/preprocess/pad.py | Simplifies tuple unpacking. |
| src/clearex/mip_export/pipeline.py | Black formatting adjustments. |
| src/clearex/main.py | Integrates registration into workflow execution and provenance outputs; adds import fallback. |
| src/clearex/io/provenance.py | Black formatting adjustments. |
| src/clearex/io/log.py | Removes blank line. |
| src/clearex/io/experiment.py | Black formatting adjustments. |
| src/clearex/gui/app.py | Adds registration UI controls, source-aware channel/resolution discovery, tab/order updates, and label rename. |
| src/clearex/flatfield/pipeline.py | Black formatting adjustments. |
| src/clearex/filter/kernels.py | Simplifies tuple unpacking. |
| src/clearex/filter/filters.py | Docstring/spacing cleanup. |
| src/clearex/filter/init.py | Removes trailing whitespace line. |
| src/clearex/file_operations/init.py | Removes trailing whitespace line. |
| src/clearex/detect/pipeline.py | Black formatting adjustments. |
| src/clearex/context/init.py | Removes trailing whitespace line. |
| setup.py | Removes blank line. |
| examples/scripts/registration/register_round_function.py | Removes trailing whitespace line. |
| examples/scripts/registration/image_registration_class.py | Removes trailing whitespace line. |
| docs/source/conf.py | Removes blank line. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Registration channel and resolution options are rebuilt in-place. | ||
| """ | ||
| self._refresh_registration_channel_options() | ||
| self._refresh_registration_channel_options() |
There was a problem hiding this comment.
_on_registration_input_source_changed calls _refresh_registration_channel_options() twice. This is redundant at best and can cause unnecessary Zarr reads/UI churn. Remove the duplicate call so the handler refreshes channels once and then refreshes resolution levels.
| self._refresh_registration_channel_options() |
| @@ -11233,6 +11846,8 @@ def _refresh_input_source_options(self) -> None: | |||
| combo.setEnabled(self._operation_checkboxes[operation_name].isChecked()) | |||
| combo.blockSignals(False) | |||
|
|
|||
There was a problem hiding this comment.
_refresh_input_source_options rebuilds the registration input-source combo under blocked signals, but only refreshes resolution-level options afterward. The registration channel combo can become stale/invalid when the input source changes via this refresh. Consider also calling _refresh_registration_channel_options() here (ideally before resolution levels) to keep both controls consistent with the selected source.
| self._refresh_registration_channel_options() |
| ) | ||
| weight_volume = _blend_weight_volume( | ||
| source_volume.shape, blend_mode=blend_mode, overlap_zyx=overlap_zyx | ||
| ) |
There was a problem hiding this comment.
In _process_and_write_registration_chunk, weight_volume = _blend_weight_volume(...) is recomputed inside the per-position loop even though it depends only on the tile shape, blend_mode, and overlap_zyx (which are constant for all positions). This adds significant overhead for every output chunk. Precompute weight_volume once outside the loop and reuse it for each position.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13 +/- ##
==========================================
+ Coverage 48.50% 49.05% +0.55%
==========================================
Files 49 50 +1
Lines 16173 17377 +1204
==========================================
+ Hits 7844 8525 +681
- Misses 8329 8852 +523
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
<source>_pyramid/level_n) and rebuild legacy layouts when neededValidation
uv run --with requests --with pytest python -m pytest tests/gui/test_gui_execution.py tests/visualization/test_pipeline.py tests/registration/test_pipeline.py tests/test_workflow.pyuv run black .uv run ruff check src/clearex/gui/app.py src/clearex/visualization/pipeline.py src/clearex/workflow.py tests/gui/test_gui_execution.py tests/visualization/test_pipeline.py tests/registration/test_pipeline.py tests/test_workflow.py